<?php get_header(); ?>
	
		<div id="container">	
			<div id="content">
			
<?php if ( have_posts() ) : ?>

				<?php
					$postsNo = $wp_query->post_count;
					$resultsString = $postsNo." rezultate dupa: ";
					if ($postsNo == 1)
						$resultsString = $postsNo." rezultat dupa: ";
				?>

				<h1 class="search-page-title"><?php _e( $resultsString, 'shape' ); ?>
					<span><?php the_search_query(); ?></span>
				</h1>

<?php while ( have_posts() ) : the_post() ?>
<?php if (is_page() || $post->post_type == 'page') continue; ?>
				<div id="post-<?php the_ID(); ?>" <?php post_class('searchPost box-shadow-big'); ?>>
					<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf(the_title_attribute('echo=0')); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
					
<?php if ( $post->post_type == 'post' ) { ?>									
					<div class="entry-utility">
						<span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e( 'Din categoria ', 'shape' ); ?></span><?php custom_post_categories(get_the_ID()); // function defined in functions.php file ?></span>
						<?php edit_post_link( __( 'Edit', 'shape' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t\n" ) ?>
					</div><!-- #entry-utility -->	
<?php } ?>

					<div class="entry-summary">	
						<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" >
							<?php the_post_thumbnail('thumb90x90', array('class' => 'alignleft')); ?>
						</a>
<?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt, 50); ?> ...
<?php wp_link_pages('before=<div class="page-link">' . __( 'Pages:', 'shape' ) . '&after=</div>') ?>
					</div><!-- .entry-summary -->
					
				</div><!-- #post-<?php the_ID(); ?> -->

<?php endwhile; ?>

<?php else : ?>

				<div id="post-0" class="post no-results not-found">
					<h2 class="entry-title contentCharacteristic"><?php _e( 'Nici un rezultat', 'shape' ) ?></h2>
					<div class="entry-content">
						<p><?php _e( 'Ne pare rau, dar nu exista articole disponibile dupa cuvintele cautate. Va rugam incercati cu alte cuvinte cheie.', 'shape' ); ?></p>
					</div><!-- .entry-content -->
				</div>

<?php endif; ?>			

			</div><!-- #content -->		
		</div><!-- #container -->
		
<?php get_sidebar(); ?>	
<?php get_footer(); ?>